#!/bin/bash

echo "Building EbbFlow Protocol..."

# Set Go environment
export GO111MODULE=on

# Create bin directory
mkdir -p bin

# Build EbbFlow server
echo "Building EbbFlow server..."
go build -o bin/ebbflow_server src/main/ebbflow_server.go

# Build EbbFlow client
echo "Building EbbFlow client..."
go build -o bin/ebbflow_client src/main/ebbflow_client.go

# Build keygen (if needed)
echo "Building keygen..."
go build -o bin/keygen src/main/keygen.go

# Build WaterBear-only server
echo "Building WaterBear-only server..."
go build -o bin/waterbear_only_server src/main/waterbear_only_server.go

# Build WaterBear + Epoch server
echo "Building WaterBear + Epoch server..."
go build -o bin/waterbear_epoch_server src/main/waterbear_epoch_server.go

echo "Build completed successfully!"
echo "Binaries created in bin/ directory:"
ls -la bin/
